#! /usr/bin/python3

import sys
def fibonacci(n):  #生成器函数 - 斐波那契
    a, b, counter = 0, 1, 0
    while True:
        if counter > n:
             return
        a, b = b, a + b
        yield a
        counter += 1

f = fibonacci(10)
while True:
    try:
        print(next(f), end = " ")
    except StopIteration:
        print("")
        sys.exit()
